<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>3-10 vm.$root</title>
</head>
<body>
<div id="app">
  <test-component></test-component>
</div>
</body>
<script src="./js/vue.js"></script>
<script>
  Vue.component('test-component',{
    template:"<button @click='root'>look root instance</button>",
    methods:{
      root(){
        console.log(this.$root)
        console.log(this.$root===vm)
      }
    }
  })
 var vm= new Vue({
    el:"#app"
  })
</script>
</html>